import { Http } from '../util/http.js'

class LikeModel extends Http {
  updateLike(behavior, art_id, art_type) {
    let url = behavior == 'like' ? 'like' :'like/cancel'
    this.request({
         url:     url,
      method:    'POST',
        data:{
          art_id: art_id,
            type: art_type
        }
    })
  }
  //获取点赞信息
  getClassicLikeStatus(art_id,art_type,scallback){
    this.request({
          url: `classic/${art_type}/${art_id}/favor`,
      success: (res)=>{
        scallback(res)
      }
    })
  }
}

export { LikeModel }